UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wj/RKHsM5pBBRDPiWoPCwLvZqH4NcG0U/BfypRpQ4qE=' 
WHERE 
  key_id = '70f5c90977ef5039aacff1df1208de555560065fc8b5f5da3257d85cad9c19bd' 
  AND (
    token = 'Wj/RKHsM5pBBRDPiWoPCwLvZqH4NcG0U/BfypRpQ4qE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030