UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '02vIRSVLwZ4oem1Ygqj+pEz/D43zwI0c6sZiZtsrWjQ=' 
WHERE 
  key_id = 'd4505fce0dfa963eafa92b1b847cfdf61a2a72d7d9b2fb71181c0b8125c4d5cc' 
  AND (
    token = '02vIRSVLwZ4oem1Ygqj+pEz/D43zwI0c6sZiZtsrWjQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037