UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lD3/bNJL5FpGvLRYPBjMOh3lEPG0JpjeIr+9Y4mU2rs=' 
WHERE 
  key_id = '58202291d556cdbb63fa66e28e98ea3b2059868e059281f6a75920cdcb7f5db2' 
  AND (
    token = 'lD3/bNJL5FpGvLRYPBjMOh3lEPG0JpjeIr+9Y4mU2rs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031