UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SHtDnwKCChQsQsmso+ZovB1BR953b4+VZ51ssPpnlmk=' 
WHERE 
  key_id = '48e3dba7aea2967a3e0052c09c1079afedc4f334d3737189f5b68f1101fa7d50' 
  AND (
    token = 'SHtDnwKCChQsQsmso+ZovB1BR953b4+VZ51ssPpnlmk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038