UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's7C88eQGSZi9HLI8FS0BPA9P4JGSbTjzg1G869effIk=' 
WHERE 
  key_id = '00dcbd85d54618507761ad804f02ab6320cf6aafdf9e4e54d0988860c76050c4' 
  AND (
    token = 's7C88eQGSZi9HLI8FS0BPA9P4JGSbTjzg1G869effIk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042