UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0A0AvdK8WA9DbpoihosYwC0u/SHLw8yNxQO1rs0PPYQ=' 
WHERE 
  key_id = '098871fdf8cfadb3c7d0bd163bdb0d3c6d5270ceba17e9aaddaadc9dde812268' 
  AND (
    token = '0A0AvdK8WA9DbpoihosYwC0u/SHLw8yNxQO1rs0PPYQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031