UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SBfViZLe3lcI5pKfyf9NlM42Qe4ze8Q3IaUu/tooqMc=' 
WHERE 
  key_id = '5bbd6b9da6b75e9c04ba408bda8054bfe48be787387fdc86b2a42fcd7bee1edc' 
  AND (
    token = 'SBfViZLe3lcI5pKfyf9NlM42Qe4ze8Q3IaUu/tooqMc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036