UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2WfYVW7xxYvQR2URSMtR+cwFDSTUoZu4igUXycWIIhA=' 
WHERE 
  key_id = '108be4d7d7da1337a83d117a366e33e2f6e01ca028b617f15cc61a47aeeaf3f0' 
  AND (
    token = '2WfYVW7xxYvQR2URSMtR+cwFDSTUoZu4igUXycWIIhA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027