UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3hkjrl4ZJeF2Z/HcDlLt2EzH9/NZ0efvpEqcRJZJYbw=' 
WHERE 
  key_id = '9aa1edf9f20bfab8cbc36ef7597675314e6ff08ee6711fc42600f8c04fc115b4' 
  AND (
    token = '3hkjrl4ZJeF2Z/HcDlLt2EzH9/NZ0efvpEqcRJZJYbw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040