UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z0bz3kMNubxHtVxPLOsLwvjVxCNBOyl3+nX1Df3Ksc0=' 
WHERE 
  key_id = '1163173d9f19a788012d43d1f23a3f085ecf928ed47f01ef8f885a48b65b886c' 
  AND (
    token = 'z0bz3kMNubxHtVxPLOsLwvjVxCNBOyl3+nX1Df3Ksc0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038