UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KsUpBCkofFZL1TaSfn17mao1MH+oWZeBZ9l7IPEG9ig=' 
WHERE 
  key_id = '653882cc887d1a610902c757e4340b0c381289ae1fd1e8f07eb295bdc1512a54' 
  AND (
    token = 'KsUpBCkofFZL1TaSfn17mao1MH+oWZeBZ9l7IPEG9ig=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031