UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+g5XmE9SEtviwzqVKkPHL5R9UDl8LuwkiWNQgkU2pHk=' 
WHERE 
  key_id = '7e6da327ea96ee888f77365415e7a47d68be3b5584cdec075e56fef9cc63f6ef' 
  AND (
    token = '+g5XmE9SEtviwzqVKkPHL5R9UDl8LuwkiWNQgkU2pHk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044