UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LnbeGgHhzqtGDrx37d4JDs1MIjnQoFScRwLb+he7mxQ=' 
WHERE 
  key_id = 'e9848baf362553ef1316dcc5202b33685d1f42aaa2d06787fce4070000caf223' 
  AND (
    token = 'LnbeGgHhzqtGDrx37d4JDs1MIjnQoFScRwLb+he7mxQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030