UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3mD0xWByNEqIZeTMxou7QD++iaqtohJKDaH9lticX88=' 
WHERE 
  key_id = '3fc51a590dd2cd71a01ddbaadaeaf5f175a6b4b5ca25d8e02795510a6dace21a' 
  AND (
    token = '3mD0xWByNEqIZeTMxou7QD++iaqtohJKDaH9lticX88=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025