UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0fQxa8YG3S1yrXI2T6voBAUihRZ4rE0vWI+LGBJWZj8=' 
WHERE 
  key_id = '70fb0d2a3396adfbc2e2ef8040e9cdb02ca7f05f830dbc265320554168e8ea05' 
  AND (
    token = '0fQxa8YG3S1yrXI2T6voBAUihRZ4rE0vWI+LGBJWZj8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025