UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WsByxoOC+sjGYdqgd/xRPk6/kNaXJbIquZ0Kt7FJ9lo=' 
WHERE 
  key_id = '46572da0f7065d936e9b16895a78222a397fe646a8d8271cf234f02823578dfc' 
  AND (
    token = 'WsByxoOC+sjGYdqgd/xRPk6/kNaXJbIquZ0Kt7FJ9lo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033