UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C4Q1iYJMt1qa/K9SH4WwzbdHVCLh2TSDZB7zlbGwQsU=' 
WHERE 
  key_id = '9ac53d5546b59ad868144c089443b071fdabef8d01ff5d2a47f4c22ef9e17fe2' 
  AND (
    token = 'C4Q1iYJMt1qa/K9SH4WwzbdHVCLh2TSDZB7zlbGwQsU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033