UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SrY5ZljjfPRbr+oTFSFTOFAWx1m0H1WVrAAxVzjJFec=' 
WHERE 
  key_id = 'ecd0d32aaa3085dc2d5a80002cf1578ebd329a82d331202a91c88ab018244e1c' 
  AND (
    token = 'SrY5ZljjfPRbr+oTFSFTOFAWx1m0H1WVrAAxVzjJFec=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056