UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LBUF1u7R3hIBR4DqBOrIN/cwS3BrS9pD9vsPWoZmaPI=' 
WHERE 
  key_id = 'a4505bb200a5774f00e7063f84aefcf32dc1707120765e1fc718eba633816e7d' 
  AND (
    token = 'LBUF1u7R3hIBR4DqBOrIN/cwS3BrS9pD9vsPWoZmaPI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047