UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jOHs2Dl9cQerO94zbLQyLBLXGwCo38PBnlo5ZIVeQxk=' 
WHERE 
  key_id = '8ca6a64262e90f098ae00c7e96e5fb1f67f66097a893c5a65a9e56df5b6e65d5' 
  AND (
    token = 'jOHs2Dl9cQerO94zbLQyLBLXGwCo38PBnlo5ZIVeQxk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033