UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FmZ5VT2afBPma4INa4kYrFr+MNrQ+VjCXNrm4G8dBEk=' 
WHERE 
  key_id = 'c6fdd5f9077cefbaa02b2e5f28952dbd9137bff70bb4b7d414aa975c8d53f91c' 
  AND (
    token = 'FmZ5VT2afBPma4INa4kYrFr+MNrQ+VjCXNrm4G8dBEk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032