UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '06fArpoOsqEd8sQEx7J6H9Bo4ZZ6hmAN3c/ZUdfZCbs=' 
WHERE 
  key_id = 'e5c3587bff76ac33a8d3bedec1999bc83f1022a1e46d428b9fe483088819624d' 
  AND (
    token = '06fArpoOsqEd8sQEx7J6H9Bo4ZZ6hmAN3c/ZUdfZCbs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031