UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZpWiVMwhuSEDCID58qAHQbmQEL/Co04XtN91hHTOINU=' 
WHERE 
  key_id = '83f46a44aeef9b82d74e661ff15406c9608c37ea108ab709870a55af2e59e019' 
  AND (
    token = 'ZpWiVMwhuSEDCID58qAHQbmQEL/Co04XtN91hHTOINU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044