UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'asYx/UU1+i/huO+QrGr7T2vU+pZqDINofXkcZ8xD+AI=' 
WHERE 
  key_id = '3e995b1a79bb59c26a88dac19e0629f334b02d89b6bb5601d9cd0de282b99b9e' 
  AND (
    token = 'asYx/UU1+i/huO+QrGr7T2vU+pZqDINofXkcZ8xD+AI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030