UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6l8QiaxivdNOO2KqD6rIdqv4Oj1wNgryep+2vcRe7Fs=' 
WHERE 
  key_id = 'f3a03406a037d2a98af7dab34d3861cd69ef09cd00ff58e805685fba4d4a0c5d' 
  AND (
    token = '6l8QiaxivdNOO2KqD6rIdqv4Oj1wNgryep+2vcRe7Fs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016