UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bEqSvBkDuHTnU52Nbja58YEZcK/xdHvXpMhxcOF9AOQ=' 
WHERE 
  key_id = '0a5bdf346983855715a38b00dc6cd31a904617c45a9e1cbfb969f824ff5ed308' 
  AND (
    token = 'bEqSvBkDuHTnU52Nbja58YEZcK/xdHvXpMhxcOF9AOQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024