UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gyO6mY1SbaAzi+n8f3km+tiAPVZT5fTEiX+KFivm5dQ=' 
WHERE 
  key_id = '67065f53ca6df1c5542d5162ee10ce5f43c30722091704c2188fc8cd632e00ba' 
  AND (
    token = 'gyO6mY1SbaAzi+n8f3km+tiAPVZT5fTEiX+KFivm5dQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046