UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YJjR3zp4GUILSuxvR7WncGjvKy+BbDxJs4kaMZ+DB2k=' 
WHERE 
  key_id = '02104690d62b99d374f40d791c880445c794256286a8ae7aff55bbf8062ac94f' 
  AND (
    token = 'YJjR3zp4GUILSuxvR7WncGjvKy+BbDxJs4kaMZ+DB2k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029