UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jdb7EKdzDIAwi39zla5Re/IhUy54RsGJLcHj6Ceoijk=' 
WHERE 
  key_id = 'f4c795509a2a91a27c1ee96fcaa634bec72be7263f3d8c414a16af6c66b454ee' 
  AND (
    token = 'jdb7EKdzDIAwi39zla5Re/IhUy54RsGJLcHj6Ceoijk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057