UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+q17mEjdWfsM4r1OvPNDakwgNtaOqH0bM5Cr0TMsPAc=' 
WHERE 
  key_id = 'b83fbaa00e0716b5f9b3b00ebff96583494c3e5f6874533961239f5dc26f6177' 
  AND (
    token = '+q17mEjdWfsM4r1OvPNDakwgNtaOqH0bM5Cr0TMsPAc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038