UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xvaJEw2UkoQXMgDNibbrct8fFT2LD3P7NX0YcpSboSo=' 
WHERE 
  key_id = '2acc6c5d5d51f51c25a96183735fb54de92db6fbd57c48b4d535b111e80f503d' 
  AND (
    token = 'xvaJEw2UkoQXMgDNibbrct8fFT2LD3P7NX0YcpSboSo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043