UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'akyI3l3g78iz6ZF61H8e/BB7CdPsmpTjgPoBGY3zUEQ=' 
WHERE 
  key_id = 'b4e76088bf8494904244499e8189be9a6186c71eab98d577eb244ed0047e20fa' 
  AND (
    token = 'akyI3l3g78iz6ZF61H8e/BB7CdPsmpTjgPoBGY3zUEQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032