UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a2gLp6LBFnuZDWo3Av64bVy2PXpvqYOM15pxe8ixu28=' 
WHERE 
  key_id = '5dc6ead16dd11a1b88a705e7dc09322d9b8a1b9f98f7e00272048b72c4c6694c' 
  AND (
    token = 'a2gLp6LBFnuZDWo3Av64bVy2PXpvqYOM15pxe8ixu28=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027