UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zcuU8wbM3clCmXmL+oQAkrE8HDZ1sadSik52dAN/qtM=' 
WHERE 
  key_id = '5f783334ee737bc0d78a7c8c41ce2b48ba71ee91df139ce211cd9d1e420014c1' 
  AND (
    token = 'zcuU8wbM3clCmXmL+oQAkrE8HDZ1sadSik52dAN/qtM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035