UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OvOemSlzPI776P7LMGn8MTctkfQ9yhAq2oSIMo3eH04=' 
WHERE 
  key_id = '11ec21c501e881b23c30266dfea42ef030f39ec25f9f2cc4929cd41a6ea68f30' 
  AND (
    token = 'OvOemSlzPI776P7LMGn8MTctkfQ9yhAq2oSIMo3eH04=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044