UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l+xsxY5RGVzlpd5gOb6PJ5Bqx9dG7eGT3upIf7SZ9tY=' 
WHERE 
  key_id = '735b6e11fbf1cb0adf130145d13dbd2a2e0debed6f8a51a1ed0ebf0ba4f642a7' 
  AND (
    token = 'l+xsxY5RGVzlpd5gOb6PJ5Bqx9dG7eGT3upIf7SZ9tY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031